Skip to content

refact cuda ut to facilitate automation #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
May 29, 2025
Merged

refact cuda ut to facilitate automation #559

merged 22 commits into from
May 29, 2025

Conversation

n1ck-guo
Copy link
Contributor

No description provided.

n1ck-guo added 2 commits May 12, 2025 22:55
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
@n1ck-guo n1ck-guo requested a review from XuehaoSun May 13, 2025 05:49
Signed-off-by: n1ck-guo <[email protected]>
n1ck-guo and others added 10 commits May 22, 2025 13:53
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: Sun, Xuehao <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
n1ck-guo added 2 commits May 28, 2025 21:25
Signed-off-by: n1ck-guo <[email protected]>
Signed-off-by: n1ck-guo <[email protected]>
@@ -134,10 +134,13 @@ def quant_tensor_sym_dq(

scale = scale.view(-1, 1)
zp = torch.full_like(scale, maxq) # pylint: disable=E1130
scale = torch.where(scale < 0, torch.clamp(scale, max=-q_scale_thresh), torch.clamp(scale, min=q_scale_thresh))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you using full-range symmetric quantization here? As I mentioned earlier, it may not be well-suited for double quantization. Do you have any accuracy data to support this choice?

int_w = round_ste(tensor / scale + v)
q = torch.clamp(int_w + zp, 0, 2 ** bits - 1)
qdq_result = (scale * (q - zp)).to(tensor.dtype)
qdq_result = revert_tensor_by_pad(qdq_result, orig_shape=orig_shape, pad_len=pad_len)
if qdq_result.isnan().sum() > 0:
breakpoint()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deleted later

@n1ck-guo n1ck-guo merged commit e075d43 into main May 29, 2025
8 checks passed
@n1ck-guo n1ck-guo deleted the hengguo/refact_ut branch May 29, 2025 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants